package com.aztec.ims.service.dao;

import java.util.List;

import com.aztec.ims.domain.CarrierInformation;
import com.aztec.ims.service.response.GenericResponse;

public class TestCarrierDetailsDao {
	public static void main(String[] args) {

		save();
		get();
	}

	private static void save() {
		CarrierDetailsDao dao = new CarrierDetailsDao();
		CarrierInformation request = new CarrierInformation("Fedex");
		GenericResponse response = dao.createCarrierDetails(request);
		System.out.println("*****Carrier id generated:" + response.getId()
				+ "******");
	}

	private static void get() {
		CarrierDetailsDao dao = new CarrierDetailsDao();
		List list = dao.getCarrierDetails();
		for(int i=0;i<list.size();i++){
			CarrierInformation info = (CarrierInformation)list.get(i);
			System.out.println("***"+i+":"+info.getCarrierId()+" ** :"+info.getCarrierName());
		}
	}

}
